home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / htttrack / httrack-3.41-3.exe / {app} / src / htsmodules.h < prev    next >
C/C++ Source or Header  |  2006-08-15  |  5KB  |  147 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. Please visit our Website: http://www.httrack.com
  29. */
  30.  
  31.  
  32. /* ------------------------------------------------------------ */
  33. /* File: htsmodules.h subroutines:                              */
  34. /*       external modules (parsers)                             */
  35. /* Author: Xavier Roche                                         */
  36. /* ------------------------------------------------------------ */
  37.  
  38. #ifndef HTS_MODULES
  39. #define HTS_MODULES
  40.  
  41. /* Forware definitions */
  42. #ifndef HTS_DEF_FWSTRUCT_lien_url
  43. #define HTS_DEF_FWSTRUCT_lien_url
  44. typedef struct lien_url lien_url;
  45. #endif
  46. #ifndef HTS_DEF_FWSTRUCT_httrackp
  47. #define HTS_DEF_FWSTRUCT_httrackp
  48. typedef struct httrackp httrackp;
  49. #endif
  50. #ifndef HTS_DEF_FWSTRUCT_struct_back
  51. #define HTS_DEF_FWSTRUCT_struct_back
  52. typedef struct struct_back struct_back;
  53. #endif
  54. #ifndef HTS_DEF_FWSTRUCT_cache_back
  55. #define HTS_DEF_FWSTRUCT_cache_back
  56. typedef struct cache_back cache_back;
  57. #endif
  58. #ifndef HTS_DEF_FWSTRUCT_hash_struct
  59. #define HTS_DEF_FWSTRUCT_hash_struct
  60. typedef struct hash_struct hash_struct;
  61. #endif
  62.  
  63. /* Function type to add links inside the module 
  64.   link : link to add (absolute or relative)
  65.   str : structure defined below
  66.   Returns 1 if the link was added, 0 if not
  67. */
  68. #ifndef HTS_DEF_FWSTRUCT_htsmoduleStruct
  69. #define HTS_DEF_FWSTRUCT_htsmoduleStruct
  70. typedef struct htsmoduleStruct htsmoduleStruct;
  71. #endif
  72. typedef int (* t_htsAddLink)(htsmoduleStruct* str, char* link);
  73.  
  74. /* Structure passed to the module */
  75. struct htsmoduleStruct {
  76.   /* Read-only elements */
  77.   const char* filename;           /* filename (C:\My Web Sites\...) */
  78.   int   size;                     /* size of filename (should be > 0) */
  79.   const char* mime;               /* MIME type of the object */
  80.   const char* url_host;           /* incoming hostname (www.foo.com) */
  81.   const char* url_file;           /* incoming filename (/bar/bar.gny) */
  82.   
  83.   /* Write-only */
  84.   const char* wrapper_name;       /* name of wrapper (static string) */
  85.   char* err_msg;                  /* if an error occured, the error message (max. 1KB) */
  86.   
  87.   /* Read/Write */
  88.   int relativeToHtmlLink;         /* set this to 1 if all urls you pass to addLink
  89.                                   are in fact relative to the html file where your
  90.                                   module was originally */
  91.   
  92.   /* Callbacks */
  93.   t_htsAddLink addLink;           /* call this function when links are 
  94.                                   being detected. it if not your responsability to decide
  95.                                   if the engine will keep them, or not. */
  96.  
  97.   /* Optional */
  98.   char* localLink;                /* if non null, the engine will write there the local
  99.                                   relative filename of the link added by addLink(), or
  100.                                   the absolute path if the link was refused by the wizard */
  101.   int localLinkSize;              /* size of the optionnal buffer */
  102.   
  103.   /* User-defined */
  104.   void* userdef;                  /* can be used by callback routines
  105.                                   */
  106.  
  107.   /* The parser httrackp structure (may be used) */
  108.   httrackp* opt;
  109.  
  110.   /* Internal use - please don't touch */
  111.   lien_url** liens;
  112.   struct_back* sback;
  113.   cache_back* cache;
  114.   hash_struct* hashptr;
  115.   int numero_passe;
  116.   int add_tab_alloc;
  117.   /* */
  118.   int* lien_tot_;
  119.   int* ptr_;
  120.   size_t* lien_size_;
  121.   char** lien_buffer_;
  122.   /* Internal use - please don't touch */
  123.  
  124. };
  125.  
  126. /* Used to wrap module initialization */
  127. /* return 1 if init was ok */
  128. typedef int (*t_htsWrapperInit)(char *fn, char *args);
  129. typedef int (*t_htsWrapperExit)(void);
  130. typedef int (*t_htsWrapperPlugInit)(char *args);
  131.  
  132. /* Library internal definictions */
  133. #ifdef HTS_INTERNAL_BYTECODE
  134. HTSEXT_API const char* hts_get_version_info(httrackp *opt);
  135. HTSEXT_API const char* hts_is_available(void);
  136. extern void htspe_init(void);
  137. extern void htspe_uninit(void);
  138. extern int hts_parse_externals(htsmoduleStruct* str);
  139.  
  140. extern int gz_is_available;
  141. /*extern int swf_is_available;*/
  142. extern int SSL_is_available;
  143. extern int V6_is_available;
  144. #endif
  145.  
  146. #endif
  147.